<%@ page language="java" contentType="text/html; charset=UTF8"
    pageEncoding="UTF8"%>
<%@ include file="/jsp/base/taglibs.jsp"%>
<!DOCTYPE html >
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF8">
	<title>OA</title>
	<link href="${ctx}/style/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="${ctx }/style/js/jquery.js"></script>
	<script type="text/javascript" src="${ctx }/style/js/bootstrap.min.js"></script>
	<style type="text/css">
	#left-menu {
		padding:30px 10px;  
		border-right:1px solid #ddd;
		/* background-color: #eee;  */
		background-color: #242338;
	}
	#left-menu .title {
		padding:5px;
		color:#929292;
		font-weight: 900;
		font-size: 16px;
	}
	#left-menu, #main-content {
		height:800px;  
	}
	</style>
	<script type="text/javascript">
	function showIframe(self, url) {
		document.getElementById("main-iframe").src=url;
		
		$("#left-menu .active").removeClass("active");
		if($(self).parent().is(".menubtn")) {
			$(self).parent().addClass("active");
		} else {
			$(self).parent().parent().parent().addClass("active");
		}
	}
	
	function logout() {
		
		var cfm = window.confirm("确定退出吗？");
		if(cfm) {
			window.location.href = "${ctx}/user/logout.do";
		}
		
	}
	</script>
</head>  
<body>
	<div class="container-fluid">
		<div class="row">
			<div id="left-menu" class="col-xs-2 " >  
				<div class="title">OA管理系统</div>
	           <ul class="nav nav-pills nav-stacked">
				  <li class="menubtn" role="presentation" class="active"><a href="javascript:void(0)"  onclick="showIframe(this, '${ctx }/user/page.do');">用户管理</a></li>
				  <li role="presentation">
				  	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">个人考勤<span class="caret"></span></a>
			          <ul class="dropdown-menu">
			              <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/leave/page.do');">请假管理</a></li>
						  <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/overtime/page.do');">加班管理</a></li>
						  <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/outing/page.do');">外出管理</a></li>
						  <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/travel/page.do');">出差管理</a></li>
			          </ul>
				  </li>
				  <li role="presentation">
				  	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">行政办公<span class="caret"></span></a>
			          <ul class="dropdown-menu">
			              <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/car/page.do');">车辆申请管理</a></li>
				  			<li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/officing/page.do');">办公用品管理</a></li>
			          </ul>
				  </li>
				  <li role="presentation">
				  	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">人力资源<span class="caret"></span></a>
			          <ul class="dropdown-menu">
			              <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/personnel/page.do');">个人档案管理</a></li>
				  		  <li role="presentation"><a href="javascript:void(0)" onclick="showIframe(this, '${ctx }/contract/page.do');">合同管理</a></li>
			          </ul>
				  </li>
				  <li class="menubtn" role="presentation" class="active"><a href="javascript:void(0)"  onclick="logout()">退出系统</a></li>
				</ul>
	        </div>
	        <div id="main-content" class="col-xs-10" > 
		         <iframe id="main-iframe" frameborder="0" width="100%" height="600px" scrolling="auto" src="${ctx }/user/page.do"></iframe>
	        </div>
		</div>
	</div>
</body>
</html>